﻿using NUnit.Framework;
using TfsWrapper.Commands;

namespace TfsWrapper.Tests
{
    public class GetByIdCommandTest : TfsTest
    {
        [Test]
        public void ExecuteTest()
        {
            var spyWriter = new SpyWriter();
            var target = new GetByIdCommand(new IssueDataPrinter(spyWriter));

            target.Execute(Tfs, new[] { "2" });

            Assert.AreEqual("2", spyWriter.NextLine);
            Assert.AreEqual("Backlog item 1", spyWriter.NextLine);
            Assert.AreEqual("New", spyWriter.NextLine);
            StringAssert.AreEqualIgnoringCase("https://simoneb.visualstudio.com/DefaultCollection/IssueTrackingSandbox/_workitems/edit/2", spyWriter.NextLine);
            StringAssert.AreEqualIgnoringCase("false", spyWriter.NextLine);
        }
    }
}
